<?php /*a:2:{s:68:"D:\workspace\admin\application\admin\view\privatechat\chat_info.html";i:1747109556;s:68:"D:\workspace\admin\application\admin\view\privatechat\send_chat.html";i:1747109556;}*/ ?>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="/layuiadmin/style/private_chat_new.css?v=<?php echo config('other.ui_version'); ?>" media="all">
    <style>
        .chat_right {
            width: 100%;
            margin-left: 0px;
        }
    </style>
    <script>
        var user_id = 0;
        var session_id;
    </script>
</head>

<body>
    <input id="specialAnchorIds" value="<?php echo htmlentities($specialAnchorIds); ?>" style="display: none;">
    <input id="privateChatUploadApi" value="<?php echo htmlentities($privateChatUploadApi); ?>" style="display: none;">
    <?php if($specialAnchorsCount > 0): ?>
    <div class="chat-tab">
        <?php if(is_array($specialAnchors) || $specialAnchors instanceof \think\Collection || $specialAnchors instanceof \think\Paginator): $i = 0; $__LIST__ = $specialAnchors;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
        <div class="chat-tab-btn" data-topanchorid="<?php echo htmlentities($item['id']); ?>" id="top_<?php echo htmlentities($item['id']); ?>"><span><?php echo htmlentities($item['nick_name']); ?></span>
            <?php if($item['unread'] > 0): ?>
            <span class="chat-tab-btn-note" id="top_unread_<?php echo htmlentities($item['id']); ?>"
                data-topunread="<?php echo htmlentities($item['unread']); ?>"><?php echo htmlentities($item['unread']); ?></span>
            <?php endif; ?>
        </div>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    </div>
    <?php endif; ?>

    <div class="chat-tab">
        <?php if(is_array($anchors) || $anchors instanceof \think\Collection || $anchors instanceof \think\Paginator): $i = 0; $__LIST__ = $anchors;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
        <div class="chat-tab-btn" data-topanchorid="<?php echo htmlentities($item['id']); ?>" id="top_<?php echo htmlentities($item['id']); ?>"><span><?php echo htmlentities($item['nick_name']); ?></span>
            <?php if($item['unread'] > 0): ?>
            <span class="chat-tab-btn-note" id="top_unread_<?php echo htmlentities($item['id']); ?>"
                data-topunread="<?php echo htmlentities($item['unread']); ?>"><?php echo htmlentities($item['unread']); ?></span>
            <?php endif; ?>
        </div>
        <?php endforeach; endif; else: echo "" ;endif; ?>
    </div>

    <div class="chat_right">
        <div class="chat_session">
            <div class="session_area">
                <div class="chat_list chatList inTalk">
                </div>
            </div>

            <!--聊天内容区域-->
            <div class="chat_user">
    <div class="chat_not_list" id="chatNotArea">
        <?php if(!empty($_GET['user_id'])): ?>
        正在加载中...
        <?php else: ?>
        请选择左侧用户...
        <?php endif; ?>
    </div>
    <div class="layui-hide" style="height:100%" id="chatRightArea">
        <div style="text-align: center; color:red; margin-bottom: 5px;">如需撤回实时消息  请重新点击左侧该用户头像</div>
        <div class="user_info">
            <div class="layui-form">
                <div class="layui-form-item" id="chatUserInfo">
                    <div class="layui-inline"><strong class="nick_name"></strong></div>
                    <div class="layui-inline"><span class="user_device" id="anchorId"></span></div>
<!--                    <div class="layui-inline userip_area"><em class="em_tic">IP</em><span class="user_ip"></span></div>-->
<!--                    <div class="layui-inline"><em class="em_tic">系统</em><span class="user_device"></span></div>-->
                    <div class="layui-inline">
<!--                        <label class="layui-form-label">禁言状态：</label>-->
<!--                        <div class="layui-input-inline">-->
<!--                            <select name="band_time" lay-filter="band_time" id="bandTime">-->
<!--                                <option value="0">正常</option>-->
<!--                                <option value="10">10分钟</option>-->
<!--                                <option value="20">20分钟</option>-->
<!--                                <option value="30">30分钟</option>-->
<!--                                <option value="120">2小时</option>-->
<!--                                <option value="360">6小时</option>-->
<!--                            </select>-->
<!--                        </div>-->
                    </div>
                    <div class="layui-inline">
                    </div>
                    <div class="layui-inline chat_isover layui-hide" style="color:#FF5722"><strong>该会话已经结束</strong></div>
                </div>
            </div>
        </div>
        <div class="chat_content">
            <!--sessionid是会话表的主键id-->
            <div class="layui-hide" id="oneChatBaseInfo" data-userid="<?php echo htmlentities((isset($user_id) && ($user_id !== '')?$user_id:'')); ?>" data-username="<?php echo htmlentities((isset($user_name) && ($user_name !== '')?$user_name:'')); ?>" data-sessionid="<?php echo htmlentities((isset($session_id) && ($session_id !== '')?$session_id:'')); ?>" data-anchorid="<?php echo htmlentities((isset($anchor_id) && ($anchor_id !== '')?$anchor_id:'')); ?>" data-anchorname="<?php echo htmlentities((isset($anchor_name) && ($anchor_name !== '')?$anchor_name:'')); ?>"></div>
            <!--聊天内容列表-->
            <div class="chat_cont_list" id="imTalkList">
                <dl><dt>艾斯<span>2022-11-29 17:10:58</span></dt>--></dl>
            </div>
        </div>

        <!--发送聊天-->
        <!-- <div class="chat_cont_sendarea layui-form" id="chatSendArea">
            <label class="layui-form-label">头像</label>
            <div class="layui-input-inline" style="width:130px">
                <div class="layui-upload">
                    <div class="layui-upload-list" style="margin: 0px">
                        <img class="layui-upload-img" id="demo1" width="100" height="100" />
                        <p id="demoText"></p>
                        <input type="hidden" name="avatar" id="LAY_avatarSrc" placeholder="图片地址"
                            value="" class="layui-input" />
                    </div>
                </div>
            </div>
            <div class="layui-input-inline layui-btn-container" style="width: auto;">
                <button type="button" class="layui-btn layui-btn-primary" id="LAY_avatar">
                    <i class="layui-icon">&#xe67c;</i>选择头像
                </button>
            </div>
        </div> -->
      

        <div class="chat_cont_sendarea layui-form" id="chatSendArea">
            <textarea placeholder="请输入私聊内容" class="layui-textarea" name="content" id="writeContent" lay-verify="required" lay-reqText="请输入聊天内容"></textarea>
            <div class="send_btn">
                <!-- <div class="chat_cont_sendarea layui-form" id="chatSendArea">
                    <div class="layui-input-inline layui-btn-container" style="width: auto;">
                        <button type="button" class="layui-btn layui-btn-primary" id="private_img">
                            <i class="layui-icon">&#xe67c;</i>上传图片
                        </button>
                    </div>
                </div> -->
                <!-- <img id="send2" src="" > -->
                <button type="button" class="layui-btn layui-btn-primary" id="private_img" style="margin-right: 10px;">
                    <i class="layui-icon">&#xe67c;</i>上传图片
                </button>
                 <button class="layui-btn " lay-submit="" lay-filter="expert-edit" >发送</button>
            </div>
        </div>
    </div>
</div>
<style>
    .revoke_msg {
        background-color: red;
        color: white;
        padding: 2px 4px;
        margin-left: 10px;
        border: none;
        border-radius: 6px;
        font-size: 12px;
        cursor: pointer;
        transition: background-color 0.3s ease;
    }
    .revoke_msg:hover {
        background-color: darkred;
    }
</style>
<script>
    var private_chat_ws = "<?php echo htmlentities($private_chat_ws); ?>";
</script>

            <div style="position: relative; left:-80px; top:10px; z-index: 999;height: 30px;">
                <button id="ban-btn" style="display:none" onclick="private_chat_ban(user_id, session_id)"
                    class="layui-btn layui-btn-xs layui-btn-danger">禁言</button>
            </div>

        </div>
    </div>

    <script src="/layuiadmin/layui/layui.2.6.8.js"></script>
    <script src="/static/jquery.min.js"></script>
    <script src="/layuiadmin/modules/talk.js?v=<?php echo config('other.ui_version'); ?>"></script>
    <script>
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
            , version: "<?php echo config('other.ui_version'); ?>"
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'privatechat', 'form'], function () {
            var $ = layui.$;

            // 获取直播私聊列表

            // 5秒更新一次聊天
            // setInterval(function () {
            //     getSessionList();
            // }, 3000);


        });

        function private_chat_ban(user_id) {
            $.ajax({
                url: '/admin/privatechat/private_chat_ban',
                type: 'get',
                data: { "user_id": user_id },
                dataType: 'json',
                success: function (res) {
                    layer.msg('操作成功');
                    layer.closeAll('loading');
                    $("#ban-btn").html(res.data.btn)
                    $("#" + session_id).attr("data-ban", res.data.ban)
                },
                error: function (err) {
                    layer.msg('系统异常,请稍后再试!');
                },
                complete: function () {
                    layer.closeAll('loading');
                }
            });
        }
    </script>
</body>

</html>